<!doctype html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport"
          content="width=device-width, user-scalable=no, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        main{
            height: 100vh;
            background-color: cyan;
            animation-name: rotate;
            animation-duration:2s;
            position: relative;
        }
        main:after{
            content:'Hello Main';
            position: absolute;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            animation-name: opacity;
            opacity: 0;
            animation-delay: 3s;
            animation-duration:.8s;
            animation-fill-mode:forwards;
        }
        nav{
            width: 0;
            height: 5rem;
            background-color: pink;
            position: relative;
            animation-name: trans;
            animation-duration: .8s;
            animation-delay: 2s;
            /*margin-left: -100vw;*/
            animation-fill-mode: forwards;
        }
        nav:after{
            content: 'Hello World';
            position: absolute;
            left: 50%;
            top: 50%;
            transform: translate(-50%, -50%);
            opacity: 0;
            animation:opacity;
            /*margin-left: -100vw;*/
            animation-duration:.8s;
            animation-delay:3s;
            animation-fill-mode:forwards;
        }

        @keyframes rotate{
            from{
                transition: none;
            }
            to{
                transform: rotate(360deg);
            }
        }
        @keyframes opacity{
            from{
                opacity: 0;
            }
            to{
                opacity: 1;
            }
        }
        @keyframes trans {
            from{
                width: 0;
            }
            to{
                width: 100vw;
            }
        }
    </style>
</head>
<body>
<main>
    <nav></nav>
    <article></article>
</main>
</body>
</html>
